package com.ymttest.database.mongo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import com.ymt.core.tool.Logger;
import com.ymt.database.MongoDBDriver;

/************************************************************************************
 * @File name :ProductBasicInfo.java
 * @Author : xujiewei
 * @Date : 2016年6月28日
 * @Copyright : 洋码头
 * 商品合库 新库
 ************************************************************************************/
public class ProductActivityInfoWapper {
	MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_YmtProductDBdriver("ProductActivityInfo");

		public ProductActivityInfoWapper(){
	    }
		

	  
	    
	    public Map<String, Object> getByProductId(String productId) throws Exception {
	        Map<String, Object> scmb = new HashMap<String, Object>();
	        ArrayList<Map> list = mdd.selectPartLimitToMap("{\"ProductId\":\"" + productId + "\"}",1);
	             try {
	            if (list.size() > 0) {
	                scmb = list.get(0);
	                return scmb;
	            }
	        } catch (Exception e) {
	            Logger.debug("err data productId:" + productId);
	            e.printStackTrace();
	        }
	        return null;
	    }
	    
	    
	    public static void main(String[] args) throws Exception {
			System.out.println(new ProductActivityInfoWapper().getByProductId("e0c44204-7856-4deb-ab88-a6a0fff1cd70").get("HasSubsidy"));
		}
}
